<script type="text/javascript">
var swfu_
$(function(){
	var btn = $("#upbtn").get(0);
    swfu_= new SWFUpload({
				upload_url: "/upload/upload",
                file_post_name: "filedata",
				file_size_limit : "1 MB",
				file_types : "*.jpg;*.png;*.jpeg'*.bmp",
				file_types_description : "bmp,jpeg,jpg,png图片",
				file_upload_limit :5,
				post_params : {
		           "bizType" : "SHOP",
		           "fileType" : "IMAGE",
		           "fileName" : ""
			    },
				swfupload_preload_handler : preLoad,
				swfupload_load_failed_handler : loadFailed,
				file_queue_error_handler : fileQueueError,
				file_dialog_complete_handler : fileDialogComplete,
				upload_progress_handler : uploadProgress,
				upload_error_handler : uploadError,
				upload_success_handler : function(f,data){
					//alert(data);
					eval("var json="+data+";");
					//alert(json.message);
					if(json.message=="Success!"){
						var htmstr="";
						htmstr+="<div style='float:left;'>";
						htmstr+='<input type="hidden" name="market.logo" value="'+json.data.urls+'">';
						htmstr+='<img height="200px"src="'+json.data.urls+'"/>';
						htmstr+='<br/><a href="#" class="easyui-linkbutton" onclick="javascript:$(this).parent().remove();"><b>删除</b></a>';
						htmstr+='</div>';
						$("#img_div").append(htmstr);
						/*$('.easyui-linkbutton').linkbutton({    
						    iconCls: 'icon-remove'
						});*/ 
					}else{
						$.messager.alert('警告','文件上传出错');
					}
				},
				upload_complete_handler : uploadComplete,
				// Button Settings
				button_placeholder_id:"upbtn",
				button_image_url : "/img/SmallSpyGlassWithTransperancy_17x18.png",
				button_width: 80,
				button_height: 18,
				button_text : '<span class="button">上传市场图片</span>',
				button_text_style : '.button {font-size: 12pt; }',
				button_text_top_padding: 0,
				button_text_left_padding: 18,
				button_disabled : false,
				button_window_mode: SWFUpload.WINDOW_MODE.TRANSPARENT,
				button_cursor: SWFUpload.CURSOR.HAND,
				// Flash Settings
				flash_url : swfuploaddir+"/swfupload.swf",
				flash9_url : swfuploaddir+"/swfupload_fp9.swf",
				custom_settings : {
				//	upload_target : "divFileProgressContainer",
					thumbnail_height: 500,
					thumbnail_width: 500,
					thumbnail_quality: 100
				},
				debug: true
			});
		});
		
</script>
<form method="post" id="editForm" name="editForm">
	<input type="hidden" name="market.id" value="${(po.id)!}" id="poid">
	<div id="tt" class="easyui-tabs" style="width: 786px; height: 450px;">
		<div title="市场信息" style="padding: 5px;">
			<table class="tableForm tableCss">
				<tr>
					<th><font color=red>*</font>市场名称</th>
					<td>
						<input type="text" name="market.name" class="easyui-validatebox" 
						value="${(po.name)!}" data-options="required:true"/>
					</td>
					<th><font color=red>*</font>联系电话</th>
					<td><input type="text" name="market.phone" class="easyui-validatebox"
						value="${(po.phone)!}" data-options="required:true"></td>
				</tr>
				<tr>
					<th><font color=red>*</font>所属城市名称</th>
					<td>
						<input type="text" name="market.address" class="easyui-validatebox"
						value="${(po.address)!}" data-options="required:true"/>
					</td>
				</tr>
				<tr>
					<th>市场简介</th>
					<td colspan="3">
						<textarea name="market.summary" cols="70" rows="3">${(po.summary)!}</textarea>
					</td>
				</tr>
				<tr>
					<th>图片</th>
					<td colspan="3">
						<div title="图片" style="padding:5px;">
							<div class="tableForm datagrid-toolbar" >
								<div style="width:60px;border:1px;">
									<span id="upbtn"></span>
								</div>
								<div id="img_div">
									<#if po?? && po.logo??>
									<div style='float:left;'>
										<input type="hidden" name="market.logo" value="${(po.logo)!}">
										<img src="${(po.logo)!}" height="200px"/>
										<br/>
										<a href="#" class="easyui-linkbutton" onclick="javascript:$(this).parent().remove();"><b>删除</b></a>
									</div>
									</#if>
								</div>
							</div>
						</div>
					</td>
				</tr>
			</table>
		</div>
	</div>
</form>